<<<<<<< HEAD
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Repay extends MY_Controller {
	
	function __construct(){
		parent::__construct();
		/** 登陆验证 */
		$user = $this->session->userdata('rsh_user');
		if(!isset($user['user_id']) || !$user['user_id']){
			$str = $_SERVER['REQUEST_URI'];
			$this->js->go("/login/index.html");
			exit;
		}
		
		$this->tab = 'user';
		$this->sub = 'account';
	}
	//充值
	public function zhs_recharge(){
		$act = $this->input->post('act');
		$user = $this->session->userdata('rsh_user');
		$this->load->helper('captcha');
		
		$data = $this->get_user_info('account_recharge','account_info');
		$this->load->model('User_model', 'user');
		$this->load->model('Payment_model', 'payment');
		$this->load->model('Accountrecharge_model', 'recharge');
		$data['payment_list0']=$this->payment->get_list(1);
		$data['var_payment_bank'] 		= $this->payment->arrays('var_payment_bank');
		
		if($act == 'submit'){
			$msg = '';
			$time = time();
			$type  = $this->input->post('type');
			$money = $this->input->post('money');
			$captcha = $this->input->post('captcha');
			if($captcha == ''){
				$msg = '验证码不能为空';
			}elseif ($captcha!=$_SESSION['captcha']){
				$msg = '验证码不正确';
			}elseif(!is_numeric($money)){
				$msg = '无效的金额';
			}else{
				$money = round($money,2);	
				if($money < 0){
					$msg = '无效的金额';
				}else{
					if($type == '1'){//网上充值
						$bank_fun = '';
						$bank_code = '';
						$bank_str = $this->input->post('bankRadio');
						$payment1 = $this->input->post('payment1');
						if((isset($bank_str) && $bank_str != '') && (isset($payment1) && $payment1!='')){
							$msg = '只能选择一种支付方式';
						}
						if (isset($bank_str) && $bank_str != ''){
							$bank = explode("|",$bank_str);
							$payment = $bank[1];
							$bank_code = $bank[0];
							$bank_fun = $bank[2];
						}elseif(isset($payment1) && $payment1!=''){
							$payment = $payment1;
						}else{
							$msg = '请选择银行卡或者第三方支付平台';
						}
						$remark = $this->input->post('payname'.$payment). '在线充值';
						$timetmp = strtotime('2013-10-01 00:00:00');
						$fee = 0.0;
						
					}else{
						$msg = '无效的充值方式';
					}
					if($msg==''){
						
						$recharge = array(
							'user_id' => $user['user_id'],
							'trade_no' => $time.$user['user_id'].rand(1,9),
							'fstatus' => 0,
							'money' => $money,
							'payment' => $payment,
							'freturn' => '',
							'ftype' => $type,
							'remark' => $remark,
							'fee' => $fee.'',
							'verify_userid' => 0,
							'verify_time' => $time,
							'verify_ip' => '',
							'verify_remark' => '',
							'add_time' => $time,
							'addip' => $this->input->ip_address()
						);
						$res = $this->recharge->add($recharge);
						
						if($res > 0){
							if($type == 1){//网上充值
								
								/*$this->load->model('Payment_model', 'payment');
								$recharge['bank'] = $bank_fun;
								$recharge['bankAbbr'] = $bank_code;*/
								//$this->payment->submit($recharge);
								//调用宝付充值接口
								$this->load->library('baofooSdk/baofooRequestService',null,'br');
								$conf['order_id'] = $recharge['trade_no'];			//订单号 (唯一不可重复)
								$conf['user_id'] = $user['user_id'];								//用户编号(唯一)
								$conf['amount'] = $recharge['money'];				//充值金额，单位：元
								$conf['fee'] = $recharge['fee'];					//充值手续费,单位：元
								$conf['fee_taken_on'] = "1";						//费用承担方(宝付收取的费用),1平台2用户自担 
								$conf['additional_info'] = "";
								$conf['page_url'] = "http://www.runshi.com/account/zhs_recharge.html";
								$conf['return_url'] = "http://www.runshi.com/callback/page_Recharge_service";
								$this->load->library('baofooSdk/dto/request/rechargePage',$conf,'recharge_1');

								$this->br->page_Recharge($this->recharge_1);
								
							}elseif($type == 2){//用户线下充值
								$msg = '充值已提交，请等待审核';
							}
						}else{
							$msg = '提交失败';
						}
					}
				}
			}
			$data['msg'] = $msg;
			
		}

			$parms['page_start'] = intval($this->input->get('per_page'));
			$parms['page_size'] = 10;
			$parms['where']['user_id'] = $user['user_id'];
			$resData = $this->recharge->get_accountrecharge_list($parms);
			$data['list'] = $resData['accountrecharge_list'];
			$data['recharge_status'] 	= $this->recharge->arrays("account_recharge_status");
			$data['recharge_type'] 	= $this->recharge->arrays("account_recharge_type");
			$data['payment_list'] = $this->payment->get_list();
			$data['group_total'] = $this->recharge->get_recharge_group_sum($user['user_id']);
			$this->load->library('pagination');
			$config['base_url'] = '/account/zhs_recharge/index.html?';
			$config['total_rows'] = $resData['accountrecharge_count'];
			$config['per_page'] = 20;
			$config['first_link'] = '首页';
			$config['next_link'] = '下一页';
			$config['prev_link'] = '上一页';
			$config['last_link'] = '尾页';
			$this->pagination->initialize($config);
			
			$data['user_sub'] = 'repay_recharge';
			$data['sub'] = 'user_repay';
			$data['sub_1'] = "会员中心";
			$data['sub_1_href'] = "/user/zhs_center.html";
			
			// TODO 待完成
			$data['sub_2'] = "借款管理";
			$data['sub_2_href'] = "/repay/zhs_details.html";
			
			// TODO 待完成
			$data['sub_3'] = "还款直通车";
			$data['sub_3_href'] = "/repay/zhs_recharge";
			
			$data['title'] = "账户充值".' - '.CON_KEYWORDS;
			$this->load->view('account/zhs_account_recharge',$data);		
		
	}
	
	//充值日志
	function recharge_log(){
		$user = $this->session->userdata('rsh_user');
		$data = array();
		$parms['page_start'] = intval($this->input->get('per_page'));
		$parms['page_size'] = 20;
		$parms['where']['user_id'] = $user['user_id'];
		$this->load->model('Accountrecharge_model', 'recharge');
		$this->load->model('Payment_model', 'payment');
		//充值统计
		$data = $this->get_user_info('account_recharge_log','account_info');
		$resData = $this->recharge->get_accountrecharge_list($parms);
		$data['list'] = $resData['accountrecharge_list'];
		$data['recharge_status'] 	= $this->recharge->arrays("account_recharge_status");
		$data['recharge_type'] 	= $this->recharge->arrays("account_recharge_type");
		$data['payment_list'] = $this->payment->get_list();
		$data['group_total'] = $this->recharge->get_recharge_group_sum($user['user_id']);
		$this->load->library('pagination');
		$config['base_url'] = '/account/recharge_log/index.html?';
		$config['total_rows'] = $resData['accountrecharge_count'];
		$config['per_page'] = 20;
		$config['first_link'] = '首页';
		$config['next_link'] = '下一页';
		$config['prev_link'] = '上一页';
		$config['last_link'] = '尾页';
		$this->pagination->initialize($config);

		$data['title'] = "充值记录".' - '.CON_KEYWORDS;
		$this->load->view('/account/account_recharge_log', $data);
	}
	


    // 我的借款明细
	function my_repay(){
	// 标的安全等级
		$this->load->model('Conset_model');
		$this->load->model('Borrow_model');
		$data['borrow_fsafe'] 				= $this->Conset_model->get_credit_title_list();	
		$data['borrow_style'] 	= $this->Borrow_model->arrays('borrow_style');//还款方式
		$data['borrow_bill_bank'] 				= $this->Borrow_model->arrays('borrow_bill_bank');//银行
		$data['borrow_status'] 				= $this->Borrow_model->arrays('borrow_status');//状态
		$data['borrow_type'] 				= $this->Borrow_model->arrays('borrow_type');//标类型
		$user = $this->session->userdata('rsh_user');
		$adata['page_start'] = intval($this->input->get('per_page'));//intval($page);
		$adata['page_size'] = 8;
		$adata['where']['user_id'] 	= $user['user_id'];
		//$adata['where']['fstatus'] 	= "0,1";
		
		$repay_vdata= $this->Borrow_model->get_borrow_repay($adata);
		$data['borrow_list'] = $repay_vdata['repay_list'];
		
		$this->load->library('pagination');
		$config['base_url'] = '/repay/my_repay/index.html?';
		$config['total_rows'] = $repay_vdata['repay_count'];
		$config['per_page'] = 3;
		
		$config['next_link'] = '下一页';
		$config['prev_link'] = '上一页';
		
		$this->pagination->initialize($config);

		$data['user_sub'] = 'my_repay';
		$data['sub'] = 'user_repay';
		$data['title'] 						= "用户中心".' - '.CON_KEYWORDS; 
		$data['tab'] 						= "user"; 
		$data['sub_1'] = "会员中心";
		$data['sub_1_href'] = "/user/zhs_center.html";
		$data['sub_2'] = "借款管理";
		$data['sub_2_href'] = "/repay/my_repay.html";
		$data['sub_3'] = "我的借款";
		$data['sub_3_href'] = "/repay/my_repay.html";
		$this->load->view('user/zhs_user_repay',$data);
	
	}
	
	// 我的还款明细
	function repay_detail(){
		$act = $this->input->get('act');
		if ($act == 'excel'){
			$this->collexcel();
		}else{
			$per_page 					= $this->input->get('per_page')?$this->input->get('per_page'):0;
			$user = $this->session->userdata('rsh_user');
			
			$data['where']['user_id'] 	= $user['user_id'];
			$data['where']['fstatus'] 	= 0;
			$data['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$data['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			$data['select'] 	= 1;
			$data['order'] 		= 1;
			$data['page_size']  = USER_CENTER_PAGE_SIZE;
			$data['page_start'] = (int)$per_page;
			
			$data['type'] = 3;//应还
			$this->load->model('Borrow_model');
			$vdata = $this->get_user_info('tender_coll','success','tender');
			$coll_vdata = $this->Borrow_model->get_repay_list($data);
			
			$vdata['repayment_list'] = $coll_vdata['repayment_list'];
			//if(count($vdata['collection_list']) < 1)$this->js->alert('查询无符合条件的数据');
			
			//分页
			$this->load->library('pagination');
			$config['base_url'] = "/repay/repay_detail.html?strtime=".$data['where']['strtime']."&endtime=".$data['where']['endtime'];
			$config['total_rows'] = $vdata['repayment_count'];
			$config['per_page'] = USER_CENTER_PAGE_SIZE; 
			$this->pagination->initialize($config); 
			$vdata['type'] = $data['type'];
			$vdata['title'] 						= "还款明细".' - '.CON_KEYWORDS;
			
			$vdata['sub'] = 'user_repay';
			$vdata['user_sub'] ='repay_msg';
			
			$vdata['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$vdata['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			
			$vdata['sub_1'] = "会员中心";
			$vdata['sub_1_href'] = "/user/zhs_center.html";
			
			$vdata['sub_2'] = "借款管理";
			$vdata['sub_2_href'] = "/repay/my_repay.html";
			
			$vdata['sub_3'] = "还款明细";
			$vdata['sub_3_href'] = "/repay/repay_detail.html";
			$vdata['borrow_type'] 				= $this->Borrow_model->arrays('borrow_type');//标类型
		
			$this->load->view('/user/zhs_user_borrow_repay', $vdata);
		}
	
	}
	
	
	function repay_ydetail(){
		$act = $this->input->get('act');
		if ($act == 'excel'){
			$this->collexcel();
		}else{
			$per_page 					= $this->input->get('per_page')?$this->input->get('per_page'):0;
			$user = $this->session->userdata('rsh_user');
			
			$data['where']['user_id'] 	= $user['user_id'];
			$data['where']['fstatus'] 	= 1;
			$data['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$data['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			$data['select'] 	= 1;
			$data['order'] 		= 4;
			$data['page_size']  = USER_CENTER_PAGE_SIZE;
			$data['page_start'] = (int)$per_page;
			
			$data['type'] = 4;//应还
			$this->load->model('Borrow_model');
			$vdata = $this->get_user_info('tender_coll','success','tender');
			$coll_vdata = $this->Borrow_model->get_repay_list($data);
			
			$vdata['repayment_list'] = $coll_vdata['repayment_list'];
			//if(count($vdata['collection_list']) < 1)$this->js->alert('查询无符合条件的数据');
			
			//分页
			$this->load->library('pagination');
			$config['base_url'] = "/repay/repay_detail.html?strtime=".$data['where']['strtime']."&endtime=".$data['where']['endtime'];
			$config['total_rows'] = $vdata['repayment_count'];
			$config['per_page'] = USER_CENTER_PAGE_SIZE; 
			$this->pagination->initialize($config); 
			$vdata['type'] = $data['type'];
			$vdata['title'] 						= "还款明细".' - '.CON_KEYWORDS;
			
			$vdata['sub'] = 'user_repay';
			$vdata['user_sub'] ='repay_msg';
			
			$vdata['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$vdata['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			
			$vdata['sub_1'] = "会员中心";
			$vdata['sub_1_href'] = "/user/zhs_center.html";
			
			$vdata['sub_2'] = "借款管理";
			$vdata['sub_2_href'] = "/repay/my_repay.html";
			
			$vdata['sub_3'] = "还款明细";
			$vdata['sub_3_href'] = "/repay/repay_detail.html";
		
			$this->load->view('/user/zhs_user_borrow_repay', $vdata);
		}
	
	}
	
	
	
=======
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Repay extends MY_Controller {
    
	function __construct(){
		parent::__construct();
		/** 登陆验证 */
		$user = $this->session->userdata('rsh_user');
		if(!isset($user['user_id']) || !$user['user_id']){
			$str = $_SERVER['REQUEST_URI'];
			$this->js->go("/login/index.html");
			exit;
		}
		
		$this->tab = 'user';
		$this->sub = 'account';
	}
	//充值
	public function zhs_recharge(){
		$act = $this->input->post('act');
		$user = $this->session->userdata('rsh_user');
		$this->load->helper('captcha');
		
		$data = $this->get_user_info('account_recharge','account_info');
		$this->load->model('User_model', 'user');
		$this->load->model('Payment_model', 'payment');
		$this->load->model('Accountrecharge_model', 'recharge');
		$data['payment_list0']=$this->payment->get_list(1);
		$data['var_payment_bank'] 		= $this->payment->arrays('var_payment_bank');
		
		if($act == 'submit'){
			$msg = '';
			$time = time();
			$type  = $this->input->post('type');
			$money = $this->input->post('money');
			$captcha = $this->input->post('captcha');
			if($captcha == ''){
				$msg = '验证码不能为空';
			}elseif ($captcha!=$_SESSION['captcha']){
				$msg = '验证码不正确';
			}elseif(!is_numeric($money)){
				$msg = '无效的金额';
			}else{
				$money = round($money,2);	
				if($money < 0){
					$msg = '无效的金额';
				}else{
					if($type == '1'){//网上充值
						$bank_fun = '';
						$bank_code = '';
						$bank_str = $this->input->post('bankRadio');
						$payment1 = $this->input->post('payment1');
						if((isset($bank_str) && $bank_str != '') && (isset($payment1) && $payment1!='')){
							$msg = '只能选择一种支付方式';
						}
						if (isset($bank_str) && $bank_str != ''){
							$bank = explode("|",$bank_str);
							$payment = $bank[1];
							$bank_code = $bank[0];
							$bank_fun = $bank[2];
						}elseif(isset($payment1) && $payment1!=''){
							$payment = $payment1;
						}else{
							$msg = '请选择银行卡或者第三方支付平台';
						}
						$remark = $this->input->post('payname'.$payment). '在线充值';
						$timetmp = strtotime('2013-10-01 00:00:00');
						$fee = 0.0;
						
					}else{
						$msg = '无效的充值方式';
					}
					if($msg==''){
						
						$recharge = array(
							'user_id' => $user['user_id'],
							'trade_no' => $time.$user['user_id'].rand(1,9),
							'fstatus' => 0,
							'money' => $money,
							'payment' => $payment,
							'freturn' => '',
							'ftype' => $type,
							'remark' => $remark,
							'fee' => $fee.'',
							'verify_userid' => 0,
							'verify_time' => $time,
							'verify_ip' => '',
							'verify_remark' => '',
							'add_time' => $time,
							'addip' => $this->input->ip_address()
						);
						$res = $this->recharge->add($recharge);
						
						if($res > 0){
							if($type == 1){//网上充值
								
								/*$this->load->model('Payment_model', 'payment');
								$recharge['bank'] = $bank_fun;
								$recharge['bankAbbr'] = $bank_code;*/
								//$this->payment->submit($recharge);
								//调用宝付充值接口
								$this->load->library('baofooSdk/baofooRequestService',null,'br');
								$conf['order_id'] = $recharge['trade_no'];			//订单号 (唯一不可重复)
								$conf['user_id'] = $user['user_id'];								//用户编号(唯一)
								$conf['amount'] = $recharge['money'];				//充值金额，单位：元
								$conf['fee'] = $recharge['fee'];					//充值手续费,单位：元
								$conf['fee_taken_on'] = "1";						//费用承担方(宝付收取的费用),1平台2用户自担 
								$conf['additional_info'] = "";
								$conf['page_url'] = "http://www.runshi.com/account/zhs_recharge.html";
								$conf['return_url'] = "http://www.runshi.com/callback/page_Recharge_service";
								$this->load->library('baofooSdk/dto/request/rechargePage',$conf,'recharge_1');

								$this->br->page_Recharge($this->recharge_1);
								
							}elseif($type == 2){//用户线下充值
								$msg = '充值已提交，请等待审核';
							}
						}else{
							$msg = '提交失败';
						}
					}
				}
			}
			$data['msg'] = $msg;
			
		}

			$parms['page_start'] = intval($this->input->get('per_page'));
			$parms['page_size'] = 10;
			$parms['where']['user_id'] = $user['user_id'];
			$resData = $this->recharge->get_accountrecharge_list($parms);
			$data['list'] = $resData['accountrecharge_list'];
			$data['recharge_status'] 	= $this->recharge->arrays("account_recharge_status");
			$data['recharge_type'] 	= $this->recharge->arrays("account_recharge_type");
			$data['payment_list'] = $this->payment->get_list();
			$data['group_total'] = $this->recharge->get_recharge_group_sum($user['user_id']);
			$this->load->library('pagination');
			$config['base_url'] = '/account/zhs_recharge/index.html?';
			$config['total_rows'] = $resData['accountrecharge_count'];
			$config['per_page'] = 20;
			$config['first_link'] = '首页';
			$config['next_link'] = '下一页';
			$config['prev_link'] = '上一页';
			$config['last_link'] = '尾页';
			$this->pagination->initialize($config);
			
			$data['user_sub'] = 'repay_recharge';
			$data['sub'] = 'user_repay';
			$data['sub_1'] = "会员中心";
			$data['sub_1_href'] = "/user/zhs_center.html";
			
			// TODO 待完成
			$data['sub_2'] = "借款管理";
			$data['sub_2_href'] = "/repay/zhs_details.html";
			
			// TODO 待完成
			$data['sub_3'] = "还款直通车";
			$data['sub_3_href'] = "/repay/zhs_recharge";
			
			$data['title'] = "账户充值".' - '.CON_KEYWORDS;
			$this->load->view('account/zhs_account_recharge',$data);		
		
	}
	
	//充值日志
	function recharge_log(){
		$user = $this->session->userdata('rsh_user');
		$data = array();
		$parms['page_start'] = intval($this->input->get('per_page'));
		$parms['page_size'] = 20;
		$parms['where']['user_id'] = $user['user_id'];
		$this->load->model('Accountrecharge_model', 'recharge');
		$this->load->model('Payment_model', 'payment');
		//充值统计
		$data = $this->get_user_info('account_recharge_log','account_info');
		$resData = $this->recharge->get_accountrecharge_list($parms);
		$data['list'] = $resData['accountrecharge_list'];
		$data['recharge_status'] 	= $this->recharge->arrays("account_recharge_status");
		$data['recharge_type'] 	= $this->recharge->arrays("account_recharge_type");
		$data['payment_list'] = $this->payment->get_list();
		$data['group_total'] = $this->recharge->get_recharge_group_sum($user['user_id']);
		$this->load->library('pagination');
		$config['base_url'] = '/account/recharge_log/index.html?';
		$config['total_rows'] = $resData['accountrecharge_count'];
		$config['per_page'] = 20;
		$config['first_link'] = '首页';
		$config['next_link'] = '下一页';
		$config['prev_link'] = '上一页';
		$config['last_link'] = '尾页';
		$this->pagination->initialize($config);

		$data['title'] = "充值记录".' - '.CON_KEYWORDS;
		$this->load->view('/account/account_recharge_log', $data);
	}
	


    // 我的借款明细
	function my_repay(){
	// 标的安全等级
		$this->load->model('Conset_model');
		$this->load->model('Borrow_model');
		$data['borrow_fsafe'] 				= $this->Conset_model->get_credit_title_list();	
		$data['borrow_style'] 	= $this->Borrow_model->arrays('borrow_style');//还款方式
		$data['borrow_bill_bank'] 				= $this->Borrow_model->arrays('borrow_bill_bank');//银行
		$data['borrow_status'] 				= $this->Borrow_model->arrays('borrow_status');//状态
		$data['borrow_type'] 				= $this->Borrow_model->arrays('borrow_type');//标类型
		$user = $this->session->userdata('rsh_user');
		$adata['page_start'] = intval($this->input->get('per_page'));//intval($page);
		$adata['page_size'] = 8;
		$adata['where']['user_id'] 	= $user['user_id'];
		//$adata['where']['fstatus'] 	= "0,1";
		
		$repay_vdata= $this->Borrow_model->get_borrow_repay($adata);
		$data['borrow_list'] = $repay_vdata['repay_list'];
		
		$this->load->library('pagination');
		$config['base_url'] = '/repay/my_repay/index.html?';
		$config['total_rows'] = $repay_vdata['repay_count'];
		$config['per_page'] = 3;
		
		$config['next_link'] = '下一页';
		$config['prev_link'] = '上一页';
		
		$this->pagination->initialize($config);

		$data['user_sub'] = 'my_repay';
		$data['sub'] = 'user_repay';
		$data['title'] 						= "用户中心".' - '.CON_KEYWORDS; 
		$data['tab'] 						= "user"; 
		$data['sub_1'] = "会员中心";
		$data['sub_1_href'] = "/user/zhs_center.html";
		$data['sub_2'] = "借款管理";
		$data['sub_2_href'] = "/repay/my_repay.html";
		$data['sub_3'] = "我的借款";
		$data['sub_3_href'] = "/repay/my_repay.html";
		$this->load->view('user/zhs_user_repay',$data);
	
	}
	
	// 我的还款明细
	function repay_detail(){
		$act = $this->input->get('act');
		if ($act == 'excel'){
			$this->collexcel();
		}else{
			$per_page 					= $this->input->get('per_page')?$this->input->get('per_page'):0;
			$user = $this->session->userdata('rsh_user');
			
			$data['where']['user_id'] 	= $user['user_id'];
			$data['where']['fstatus'] 	= 0;
			$data['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$data['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			$data['select'] 	= 1;
			$data['order'] 		= 1;
			$data['page_size']  = USER_CENTER_PAGE_SIZE;
			$data['page_start'] = (int)$per_page;
			
			$data['type'] = 3;//应还
			$this->load->model('Borrow_model');
			$vdata = $this->get_user_info('tender_coll','success','tender');
			$coll_vdata = $this->Borrow_model->get_repay_list($data);
			
			$vdata['repayment_list'] = $coll_vdata['repayment_list'];
			//if(count($vdata['collection_list']) < 1)$this->js->alert('查询无符合条件的数据');
			
			//分页
			$this->load->library('pagination');
			$config['base_url'] = "/repay/repay_detail.html?strtime=".$data['where']['strtime']."&endtime=".$data['where']['endtime'];
			$config['total_rows'] = $vdata['repayment_count'];
			$config['per_page'] = USER_CENTER_PAGE_SIZE; 
			$this->pagination->initialize($config); 
			$vdata['type'] = $data['type'];
			$vdata['title'] 						= "还款明细".' - '.CON_KEYWORDS;
			
			$vdata['sub'] = 'user_repay';
			$vdata['user_sub'] ='repay_msg';
			
			$vdata['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$vdata['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			
			$vdata['sub_1'] = "会员中心";
			$vdata['sub_1_href'] = "/user/zhs_center.html";
			
			$vdata['sub_2'] = "借款管理";
			$vdata['sub_2_href'] = "/repay/my_repay.html";
			
			$vdata['sub_3'] = "还款明细";
			$vdata['sub_3_href'] = "/repay/repay_detail.html";
			$vdata['borrow_type'] 				= $this->Borrow_model->arrays('borrow_type');//标类型
		
			$this->load->view('/user/zhs_user_borrow_repay', $vdata);
		}
	
	}
	
	
	function repay_ydetail(){
		$act = $this->input->get('act');
		if ($act == 'excel'){
			$this->collexcel();
		}else{
			$per_page 					= $this->input->get('per_page')?$this->input->get('per_page'):0;
			$user = $this->session->userdata('rsh_user');
			
			$data['where']['user_id'] 	= $user['user_id'];
			$data['where']['fstatus'] 	= 1;
			$data['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$data['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			$data['select'] 	= 1;
			$data['order'] 		= 4;
			$data['page_size']  = USER_CENTER_PAGE_SIZE;
			$data['page_start'] = (int)$per_page;
			
			$data['type'] = 4;//应还
			$this->load->model('Borrow_model');
			$vdata = $this->get_user_info('tender_coll','success','tender');
			$coll_vdata = $this->Borrow_model->get_repay_list($data);
			
			$vdata['repayment_list'] = $coll_vdata['repayment_list'];
			//if(count($vdata['collection_list']) < 1)$this->js->alert('查询无符合条件的数据');
			
			//分页
			$this->load->library('pagination');
			$config['base_url'] = "/repay/repay_detail.html?strtime=".$data['where']['strtime']."&endtime=".$data['where']['endtime'];
			$config['total_rows'] = $vdata['repayment_count'];
			$config['per_page'] = USER_CENTER_PAGE_SIZE; 
			$this->pagination->initialize($config); 
			$vdata['type'] = $data['type'];
			$vdata['title'] 						= "还款明细".' - '.CON_KEYWORDS;
			
			$vdata['sub'] = 'user_repay';
			$vdata['user_sub'] ='repay_msg';
			
			$vdata['where']['strtime'] 	= $this->input->get('strtime') ? $this->input->get('strtime') : '';
			$vdata['where']['endtime'] 	= $this->input->get('endtime') ? $this->input->get('endtime') : '';
			
			$vdata['sub_1'] = "会员中心";
			$vdata['sub_1_href'] = "/user/zhs_center.html";
			
			$vdata['sub_2'] = "借款管理";
			$vdata['sub_2_href'] = "/repay/my_repay.html";
			
			$vdata['sub_3'] = "还款明细";
			$vdata['sub_3_href'] = "/repay/repay_detail.html";
		
			$this->load->view('/user/zhs_user_borrow_repay', $vdata);
		}
	
	}
	
	
	
>>>>>>> d47623b610d79a4eeb489500830c00d70933f414
}